:root {
    --parchment: #1a1a1a;
    --parchment-dark: #0d0d0d;
    --ink: #e0e0e0;
    --shadow: #2a1a3a;
    --shadow-light: #4a3a5a;
    --shadow-dark: #1a0a2a;
    --purple: #7a5a9a;
    --purple-light: #9a7aba;
    --purple-dark: #5a3a7a;
    --gold: #c9a961;
    --gold-dark: #9d7d3a;
    --accent: #6a4a8a;
    --accent-light: #8a6aaa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, var(--parchment) 0%, var(--shadow-dark) 100%);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.7;
}

.parchment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(122, 90, 154, 0.03) 2px,
            rgba(122, 90, 154, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 12px 20px;
    background: rgba(42, 26, 58, 0.9);
    border: 2px solid var(--purple);
    color: var(--purple-light);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(122, 90, 154, 0.3);
}

.back-button:hover {
    background: var(--purple);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 25px rgba(122, 90, 154, 0.6);
}

.hero-section {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 100px 40px 60px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(122, 90, 154, 0.15) 0%, transparent 100%);
}

.hero-image {
    flex: 0 0 400px;
    animation: fadeInLeft 1s ease-out;
    padding: 10px;
    background: linear-gradient(135deg, rgba(74, 58, 90, 0.3), rgba(106, 90, 122, 0.2));
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(122, 90, 154, 0.4);
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 
        0 10px 40px rgba(122, 90, 154, 0.6),
        0 0 0 4px var(--purple),
        0 0 0 8px rgba(122, 90, 154, 0.4);
    border: 4px solid rgba(26, 26, 26, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.02);
    box-shadow: 
        0 15px 60px rgba(122, 90, 154, 0.8),
        0 0 0 4px var(--purple-light),
        0 0 0 8px rgba(122, 90, 154, 0.6);
}

.hero-content {
    flex: 1;
    animation: fadeInRight 1s ease-out;
}

.class-title {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--purple-light);
    margin-bottom: 20px;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(122, 90, 154, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.class-quote {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--ink);
    margin-bottom: 25px;
    padding-left: 20px;
    border-left: 4px solid var(--purple);
}

.class-type {
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 600;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 40px 80px;
    position: relative;
    z-index: 2;
}

.section {
    margin-bottom: 60px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--purple-light);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--purple);
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(122, 90, 154, 0.5);
}

.intro-text {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: var(--ink);
}

.interactive-hint {
    background: rgba(122, 90, 154, 0.2);
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid var(--purple);
    margin-bottom: 25px;
    font-size: 1.05rem;
    color: var(--purple-light);
}

.content-box {
    background: rgba(42, 26, 58, 0.4);
    padding: 30px;
    border-left: 4px solid var(--purple);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.content-box p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.content-box p:last-child {
    margin-bottom: 0;
}

.highlight-box {
    background: rgba(122, 90, 154, 0.2);
    padding: 20px;
    border-radius: 6px;
    border: 2px solid var(--purple);
    margin-top: 20px;
}

.highlight-box p {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.stat-category {
    background: rgba(42, 26, 58, 0.5);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid var(--purple);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.stat-category h3 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.stat-category ul {
    list-style: none;
    padding: 0;
}

.stat-category li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(122, 90, 154, 0.3);
}

.stat-category li:last-child {
    border-bottom: none;
}

.bonus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    padding: 10px;
    background: rgba(26, 26, 26, 0.6);
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(122, 90, 154, 0.3);
}

.stat-item.positive {
    color: #7aba7a;
    border-color: #5a8f5a;
    background: rgba(90, 143, 90, 0.2);
}

.stat-item.negative {
    color: #ba7a7a;
    border-color: #8f5a5a;
    background: rgba(168, 74, 74, 0.2);
}

.stat-item.highlight {
    border: 2px solid var(--purple);
    background: rgba(122, 90, 154, 0.3);
    font-size: 1.1rem;
}

.resistance-list {
    margin-top: 15px;
}

.traits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.traits-grid span {
    padding: 8px;
    background: rgba(122, 90, 154, 0.2);
    border-radius: 4px;
    font-size: 0.95rem;
}

.talent-card {
    background: rgba(42, 26, 58, 0.5);
    padding: 25px;
    margin-bottom: 20px;
    border-left: 5px solid var(--purple);
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.talent-card:hover {
    background: rgba(42, 26, 58, 0.7);
    box-shadow: 0 8px 30px rgba(122, 90, 154, 0.4);
    transform: translateX(5px);
}

.talent-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.talent-card h4 {
    font-family: 'Cinzel', serif;
    color: var(--accent-light);
    margin: 15px 0 10px;
    font-size: 1.1rem;
}

.talent-card p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 10px;
}

.talent-card ul {
    list-style: none;
    padding-left: 0;
}

.talent-card li {
    padding: 6px 0 6px 20px;
    position: relative;
}

.talent-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--purple);
    font-weight: bold;
}

.origin-grid {
    display: grid;
    gap: 30px;
}

.origin-card {
    background: rgba(42, 26, 58, 0.6);
    padding: 30px;
    border: 3px solid var(--purple);
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.origin-card:hover {
    border-color: var(--purple-light);
    box-shadow: 0 8px 35px rgba(122, 90, 154, 0.6);
    transform: translateY(-3px);
}

.origin-card.selected {
    background: rgba(122, 90, 154, 0.3);
    border-color: var(--purple-light);
    box-shadow: 0 0 40px rgba(122, 90, 154, 0.8);
    transform: scale(1.02);
}

.origin-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.origin-card h4 {
    font-family: 'Cinzel', serif;
    color: var(--accent-light);
    margin: 20px 0 10px;
    font-size: 1.2rem;
}

.origin-card .subsection {
    background: rgba(122, 90, 154, 0.15);
    padding: 20px;
    margin: 15px 0;
    border-radius: 6px;
    border-left: 3px solid var(--purple);
}

.bonus-section {
    background: rgba(122, 90, 154, 0.25);
    padding: 20px;
    margin: 20px 0 0;
    border-radius: 8px;
    border: 2px solid var(--accent);
}

.bonus-section h4 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.choice-group {
    margin: 15px 0;
    padding: 15px;
    background: rgba(26, 26, 26, 0.4);
    border-radius: 6px;
    border: 1px solid var(--accent);
}

.choice-group p {
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 10px;
}

.choice-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    margin: 5px 10px 5px 0;
    background: rgba(42, 26, 58, 0.5);
    border: 2px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--ink);
}

.choice-label:hover {
    border-color: var(--accent-light);
    background: rgba(42, 26, 58, 0.7);
}

.choice-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--purple);
    cursor: pointer;
}

.choice-label input[type="radio"]:checked + span {
    color: var(--purple-light);
}

.choice-label:has(input:checked) {
    background: var(--accent);
    border-color: var(--purple-light);
    box-shadow: 0 0 15px rgba(122, 90, 154, 0.5);
}

.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.knowledge-item {
    background: rgba(42, 26, 58, 0.5);
    padding: 20px;
    border-left: 4px solid var(--purple);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.knowledge-item h4 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.knowledge-item .level {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 600;
}

.knowledge-item p {
    font-size: 1.05rem;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.equipment-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: rgba(42, 26, 58, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--purple);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.equipment-item:hover {
    border-color: var(--purple-light);
    box-shadow: 0 5px 25px rgba(122, 90, 154, 0.4);
}

.equipment-item .icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.equipment-item h4 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.equipment-item p {
    font-size: 0.95rem;
    color: var(--ink);
}

.competences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.competence-category {
    background: rgba(42, 26, 58, 0.5);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid var(--purple);
    backdrop-filter: blur(10px);
}

.competence-category h3 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.competence-list {
    list-style: none;
    padding: 0;
}

.competence-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(122, 90, 154, 0.3);
    font-size: 1.05rem;
}

.competence-list li:last-child {
    border-bottom: none;
}

.competence-list strong {
    color: var(--purple-light);
}

.footer {
    text-align: center;
    padding: 40px 20px 30px;
    position: relative;
    z-index: 2;
}

.divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--purple), transparent);
    margin: 0 auto 20px;
}

.footer p {
    font-size: 0.95rem;
    color: var(--gold);
    letter-spacing: 1px;
}

.chart-container {
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    padding: 20px;
    background: rgba(42, 26, 58, 0.5);
    border-radius: 12px;
    border: 2px solid var(--purple);
    backdrop-filter: blur(10px);
}

.chart-wrapper canvas {
    max-height: 400px;
}

.reputation-box {
    background: linear-gradient(135deg, rgba(122, 90, 154, 0.3), rgba(201, 169, 97, 0.1));
    padding: 25px;
    border: 3px solid var(--purple);
    border-radius: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.reputation-box h3 {
    font-family: 'Cinzel', serif;
    color: var(--purple-light);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 80px 30px 40px;
    }

    .hero-image {
        flex: 0 0 auto;
        max-width: 350px;
    }

    .class-quote {
        border-left: none;
        padding-left: 0;
        border-top: 4px solid var(--purple);
        padding-top: 15px;
    }

    .stats-grid,
    .equipment-grid,
    .competences-grid,
    .origin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .back-button {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .hero-section {
        padding: 70px 20px 30px;
    }

    .hero-image {
        max-width: 280px;
    }

    .class-title {
        font-size: 2.2rem;
    }

    .class-quote {
        font-size: 1.1rem;
    }

    .container {
        padding: 30px 20px 60px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .content-box,
    .stat-category,
    .talent-card,
    .origin-card {
        padding: 20px;
    }

    .bonus-grid,
    .traits-grid {
        grid-template-columns: 1fr;
    }
}